package com.yc.service.manager.album.impl;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.yc.dao.DaoSupport;
import com.yc.entity.Page;
import com.yc.entity.manager.AppAlbum;
import com.yc.util.PageData;
import com.yc.service.manager.album.AlbumManager;

/** 
 * 说明：专辑管理
 * 创建人： 
 * 创建时间：2017-02-09
 * @version
 */
@Service("albumService")
public class AlbumService implements AlbumManager{

	@Resource(name = "daoSupport")
	private DaoSupport dao;
	
	/**新增
	 * @param pd
	 * @throws Exception
	 */
	public void save(PageData pd)throws Exception{
		dao.save("AppAlbumMapper.save", pd);
	}
	
	/**删除
	 * @param pd
	 * @throws Exception
	 */
	public void delete(PageData pd)throws Exception{
		dao.delete("AppAlbumMapper.delete", pd);
	}
	
	/**修改
	 * @param pd
	 * @throws Exception
	 */
	public void edit(PageData pd)throws Exception{
		dao.update("AppAlbumMapper.update", pd);
	}
	
	/**列表
	 * @param page
	 * @throws Exception
	 */
	@SuppressWarnings("unchecked")
	public List<AppAlbum> list(Page page)throws Exception{
		return (List<AppAlbum>)dao.findForList("AppAlbumMapper.datalistPage", page);
	}

	/**通过id获取数据
	 * @param pd
	 * @throws Exception
	 */
	public AppAlbum findById(PageData pd)throws Exception{
		return (AppAlbum)dao.findForObject("AppAlbumMapper.findById", pd);
	}

	@Override
	public void updatechildapps(PageData pd) throws Exception {
		dao.update("AppAlbumMapper.updatechildapps", pd);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<AppAlbum> findOneByStatus(PageData pd) throws Exception {
		return (List<AppAlbum>)dao.findForList("AppAlbumMapper.findOneByStatus", pd);
	}

	@Override
	public void deleteAll(String[] ArrayDATA_IDS) throws Exception {
		dao.delete("AppAlbumMapper.deletell", ArrayDATA_IDS);
	}
	
	
	
}

